/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sklepik;

import java.util.List;

/**
 *
 * @author student
 */
public class User {

    private long id;
    private String firstName;
    private String lastName;
    private Gender gender;
    private String login;
    private String password;
    private List<Address> addresses;
    private List<Phone> phones;
    private String email;
    private Cart cart; //koszyk
    
    public User(){
        
    }

    public void setAddresses(List<Address> addresses) {
        this.addresses = addresses;
    }

    public void setCart(Cart cart) {
        this.cart = cart;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public void setId(long id) {
        this.id = id;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setPhones(List<Phone> phones) {
        this.phones = phones;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        if (this.id != other.id) {
            return false;
        }
        if ((this.firstName == null) ? (other.firstName != null) : !this.firstName.equals(other.firstName)) {
            return false;
        }
        if ((this.lastName == null) ? (other.lastName != null) : !this.lastName.equals(other.lastName)) {
            return false;
        }
        if (this.gender != other.gender) {
            return false;
        }
        if ((this.login == null) ? (other.login != null) : !this.login.equals(other.login)) {
            return false;
        }
        if ((this.password == null) ? (other.password != null) : !this.password.equals(other.password)) {
            return false;
        }
        if (this.addresses != other.addresses && (this.addresses == null || !this.addresses.equals(other.addresses))) {
            return false;
        }
        if (this.phones != other.phones && (this.phones == null || !this.phones.equals(other.phones))) {
            return false;
        }
        if ((this.email == null) ? (other.email != null) : !this.email.equals(other.email)) {
            return false;
        }
        if (this.cart != other.cart && (this.cart == null || !this.cart.equals(other.cart))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 83 * hash + (int) (this.id ^ (this.id >>> 32));
        hash = 83 * hash + (this.firstName != null ? this.firstName.hashCode() : 0);
        hash = 83 * hash + (this.lastName != null ? this.lastName.hashCode() : 0);
        hash = 83 * hash + (this.gender != null ? this.gender.hashCode() : 0);
        hash = 83 * hash + (this.login != null ? this.login.hashCode() : 0);
        hash = 83 * hash + (this.password != null ? this.password.hashCode() : 0);
        hash = 83 * hash + (this.addresses != null ? this.addresses.hashCode() : 0);
        hash = 83 * hash + (this.phones != null ? this.phones.hashCode() : 0);
        hash = 83 * hash + (this.email != null ? this.email.hashCode() : 0);
        hash = 83 * hash + (this.cart != null ? this.cart.hashCode() : 0);
        return hash;
    }
    
    
}
